<h4 class="widget-title"><i class="fa fa-search" aria-hidden="true"></i> Search</h4>

{% if page.url contains '/ja/' %}
<form action="{{ site.baseurl }}/ja/search.html" class="search-form-navi" method="get">
    <input type="text" class="search-box-navi" placeholder="" name="q">
    <input type="submit" class="search-button-navi" value="検索">
{% elsif page.url contains '/ch/' %}
<form action="{{ site.baseurl }}/ch/search.html" class="search-form-navi" method="get">
    <input type="text" class="search-box-navi" placeholder="" name="q">
    <input type="submit" class="search-button-navi" value="搜索">
{% else %}
<form action="{{ site.baseurl }}/en/search.html" class="search-form-navi" method="get">
    <input type="text" class="search-box-navi" placeholder="" name="q">
    <input type="submit" class="search-button-navi" value="Search">
{% endif %}
</form>

<h4 class="widget-title"><i class="fa fa-globe" aria-hidden="true"></i> Languages</h4>
<ul>
{% assign url = page.url | prepend: site.github.url %} 
{% if page.url contains '/en/' %}
    <li><a href="{{ site.baseurl }}{{ en_url }}" class="language-link">English</a></li>
    {% assign ja_url = url | replace: '/en/', '/ja/' %}
    {% assign ch_url = url | replace: '/en/', '/ch/' %}
    <li><a href="{{ site.baseurl }}{{ ja_url }}" class="language-link">日本語 (Japanese)</a></li>
    <li><a href="{{ site.baseurl }}{{ ch_url }}" class="language-link">中文(简体) (Chinese-Simplified)</a></li>
{% elsif page.url contains '/ja/' %}
    <li><a href="{{ site.baseurl }}{{ page.url }}" class="language-link">日本語 (Japanese)</a></li>
    {% assign en_url = url | replace: '/ja/', '/en/' %}
    {% assign ch_url = url | replace: '/ja/', '/ch/' %}
    <li><a href="{{ site.baseurl }}{{ en_url }}" class="language-link">English</a></li>
    <li><a href="{{ site.baseurl }}{{ ch_url }}" class="language-link">中文(简体) (Chinese-Simplified)</a></li>
{% elsif page.url contains '/ch/' %}
    <li><a href="{{ site.baseurl }}{{ page.url }}" class="language-link">中文(简体) (Chinese-Simplified)</a></li>
    {% assign en_url = url | replace: '/ch/', '/en/' %}
    {% assign ja_url = url | replace: '/ch/', '/ja/' %}
    <li><a href="{{ site.baseurl }}{{ en_url }}" class="language-link">English</a></li>
    <li><a href="{{ site.baseurl }}{{ ja_url }}" class="language-link">日本語 (Japanese)</a></li>
{% else %}  
    <li><a href="{{ site.baseurl }}/en/" class="language-link">English</a></li>
    <li><a href="{{ site.baseurl }}/ja/" class="language-link">日本語 (Japanese)</a></li>
    <li><a href="{{ site.baseurl }}/ch/" class="language-link">中文(简体) (Chinese-Simplified)</a></li>
{% endif %}
</ul>

<h4 class="widget-title"><i class="fa fa-files-o" aria-hidden="true"></i> Translate</h4>
{% include translate_tool.html %}

<h4 class="widget-title"><i class="fa fa-book" aria-hidden="true"></i> Users Guide</h4>
{% if page.url contains '/ja/' %}
    {% include generateDynamicMenu.html root="/ja/user-guide/" %}
{% elsif page.url contains '/ch/' %}   
    {% include generateDynamicMenu.html root="/ch/user-guide/" %}
{% else %} 
    {% include generateDynamicMenu.html root="/en/user-guide/" %}
{% endif %}

<h4 class="widget-title"><i class="fa fa-thumbs-o-up" aria-hidden="true"></i> Many Thanks to</h4>
<div class="thanks-banner">
  <a href="{{site.repository}}" target="_blank"><img src="{{site.baseurl}}/assets/images/github.png" alt="GitHub"></a>
  <a href="https://circleci.com/gh/treefrogframework/treefrog-framework/" target="_blank"><img src="{{site.baseurl}}/assets/images/circleci.png" alt="circleci"></a>
  <a href="https://ci.appveyor.com/project/treefrogframework/treefrog-framework/" target="_blank"><img src="{{site.baseurl}}/assets/images/appveyor.png" alt="AppVeyor"></a>
  <a href="https://hub.docker.com/r/treefrogframework/treefrog/" target="_blank"><img src="{{site.baseurl}}/assets/images/dockerhub.png" alt="docker hub"></a>
  <a href="http://www.ideeinc.co.jp" target="_blank"><img src="{{site.baseurl}}/assets/images/idee.png" alt="idee inc."></a>
</div>
